with Murs;
generic
   type Individu (<>) is private;
   with function "=" (i : Individu; j : Individu) return Boolean is <>;
   with function "<=" (i : Individu; j : Individu) return Boolean is <>;

   type Cercle (<>) is private;
   with function "=" (u : Cercle; v : Cercle) return Boolean is <>;
   with function "<=" (u : Cercle; v : Cercle) return Boolean is <>;

   type Texte (<>) is private;

   type Mur (<>) is private;
   with function Creer (i : Individu) return Mur is <>;
   with function Afficher(m : Mur; i : Individu; t : Texte; n : Natural) return Mur is <>;
   with function Est_defini(m : Mur; n : Natural) return Boolean is <>;
   with function Auteur(m : Mur; n : Natural) return Individu is <>;
package optimal is
   type Modele is private;
   function Creer return Modele;
   function Inscrire ( c : Modele; i : Individu ) return Modele;
   function Bloquer ( c : Modele; i : Individu; j : Individu ) return Modele;
   function Debloquer ( c : Modele; i : Individu; j : Individu ) return Modele;
   function Ajouter_cercle ( c : Modele; i : Individu; u : Cercle ) return Modele;
   function Retirer_cercle ( c : Modele; i : Individu; u : Cercle ) return Modele;
   function Ajouter_membre ( c : Modele; u : Cercle; i : Individu; j : Individu ) return Modele;
   function Retirer_membre ( c : Modele; u : Cercle; i : Individu; j : Individu ) return Modele;
   function Poster ( c : Modele; i : Individu; u : Cercle; t : Texte ) return Modele;
   function Commenter ( c : Modele; i : Individu; n : Natural; t : Texte ) return Modele;
   function Est_inscrit ( c : Modele; i : Individu ) return Boolean;
   function Nombre_inscrits ( c : Modele ) return Natural;
   function Ieme_inscrit ( c : Modele; n : Natural ) return Individu;
   function Est_bloque ( c : Modele; i : Individu; j : Individu ) return Boolean;
   function Est_cercle_de ( c : Modele; i : Individu; u : Cercle) return Boolean;
   function Nombre_cercles ( c : Modele; i : Individu ) return Natural;
   function Ieme_cercle ( c : Modele; n : Natural; i : Individu ) return Cercle;
   function Est_membre_de ( c : Modele; u : Cercle; i : Individu; j : Individu ) return Boolean;
   function Nombre_membres ( c : Modele; i : Individu; u : Cercle) return Natural;
   function Ieme_membre ( c : Modele; n : Natural; i : Individu; u : Cercle ) return Individu;
   function Nombre_posts ( c : Modele ) return Natural;
   function Consulter ( c : Modele; i : Individu ) return Mur;
private

   type les_individus (<>);
   type un_individu (<>);
   type Individus (<>);

   type un_cercle is record
      cer : access Cercle;
      membres : access Individus;
      proprietaire : access un_individu;
   end record;
   type les_cercles is array (Positive range <>) of access un_cercle;

   type un_individu is record
      ind : access Individu;
      un_mur : access Mur;
      cercles : access les_cercles;
      membres_bloquer : access Individus;
    end record;

   type les_individus is array (Positive range <>) of access un_individu;
   type Individus is array (Positive range <>) of access Individu;

   type communaute is record
      les_individuDeC : access les_individus;
      nbPost : Natural;
   end record;

   type Modele is access communaute;
   end optimal;


